A last level cache (LLC) in a central processing unit (CPU) is generally sized to hold a few megabytes (MB) of data or instruction lines of recent memory accesses to lower the latency of requests from the CPUs themselves as compared to dynamic random access memory (DRAM). While such a cache is large relative to a level 1 (L1) cache or a level 2 (L2) cache inside the CPU, an LLC—especially if shared among multiple CPUs—receives/sends all memory traffic from multiple threads which can fill up the cache rather quickly. A cache replacement policy or method is typically applied when the cache fills to capacity and needs to select which data to victimize and which data to keep for maximum performance.
An LLC or a shared cache may be either inclusive or exclusive. An exclusive shared cache is sometimes referred to as a victim cache. An inclusive cache is a cache where each data or instruction line held by a master CPU is redundantly copied within the cache itself. Tracking a redundant copy of a cacheline as well as tag state allows for an implicit, zero-cost snoop filter where any outside memory requests or snoops and/or probes may be filtered and serviced by the LLC itself, reducing memory traffic to the master CPU. A cacheline is a grouping of data associated with a cache entry.
In contrast to an inclusive cache, a victim exclusive cache is a cache where data storage only occurs after a master CPU victimizes (i.e., ejects) a cacheline. A victim exclusive cache does not hold data lines of its master CPU. This provides more efficient unique local cache storage by not polluting LLC entries with redundant data, at the expense of increased memory snoops and/or probes and greater coherence flow complexity. A victim exclusive cache typically adds a dedicated snoop filter to track a coherency state of cachelines that exist in the master CPU but not in the cache to regain the reduction in memory traffic to the master CPU. A snoop filter is LLC storage that tracks the meta-state of cachelines, but not their data payload. This helps reduce the traffic problem of a victim LLC or a fabric with no local cache.
Typically, cache replacement policies apply to an inclusive cache, and rarely for a victim exclusive cache. A victim exclusive cache has a definition of de-allocating a cacheline when it is re-referenced by a master CPU, which is not beneficial for a cache replacement policy attempting to track history.